import { OnInit, Component, ViewChild } from '@angular/core';
import { DictionaryListComponent } from './dictionary-list.component';

@Component({
  selector: 'app-dictionary-view',
  templateUrl: './dictionary-view.component.html',
  styles: [],
})
export class DictionaryViewComponent implements OnInit {
  constructor() { }

  @ViewChild('dictionaryListComponent', { static: false })
  dictionaryListComponent: DictionaryListComponent;

  /**
   * 条件查询参数
   */
  queryParams = {
    code: null,
    name: null,
  };

  /**
   * 查找字典
   */
  onSearch() {
    this.dictionaryListComponent.loadData();
  }

  /**
   * 重置表单
   */
  onResetForm() {
    this.queryParams.code = '';
    this.queryParams.name = '';
  }

  /**
   * 新建字典
   */
  create() {
    this.dictionaryListComponent.create();
  }

  /**
   * 刷新
   */
  reflesh() {
    this.dictionaryListComponent.loadData();
  }

  ngOnInit() { }
}
